package day04.ZuoYeDemo;//4. Guessing猜数字之do...while版
import java.util.Scanner;
public class GuessingDoWhileDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = (int)(Math.random()*2000000000+1);
        System.out.println("小游戏：随机猜一猜");
        int Guess;
        do {
            System.out.println("请输入数字：");
            Guess = scan.nextInt();
            if (Guess>num){
                System.out.println("猜大了");
                System.out.println("再接再厉");
            }else if (Guess<num){
                System.out.println("猜小了");
                System.out.println("再接再厉");
            }else {
                System.out.println("猜对了,你真是个小聪明");
            }
        }while (Guess!=num);
    }
}
